<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>promise-catch</title>
</head>
<body>
    <script>
        // catch 可以指定失败的回调
        let p = new Promise((resolve, reject)=>{
            reject('error123');
            // resolve('ok');
        })

        p.then(value=>{
            console.log(value);
        }).then(value=>{
            console.log(value);
        })
        // 异常（错误）穿透
        .catch(e=>{
            console.error(e);
        })
    </script>
</body>
</html>